<template>
    <div>
        <van-cell-group>
            <van-cell title="用户名" :value="user.username" />
            <van-cell title="电话" :value="user.phone"/>
            <van-cell title="邀请码" :value="user.code"/>
            <van-cell title="授信" :value="user.is_believe?'授信用户':'非授信用户'"/>
            <van-cell title="收货地址" is-link :url="node_env=='development'?'/#/addressList':'/sxplat/#/addressList'"></van-cell>
        </van-cell-group>
        <van-button type="primary" color="#3DCEB9" class="log-out" @click="loginOut" block>退出登录</van-button>
    </div>
</template>
<script>
export default {
    data() {
        return {
            user:null,
            node_env:undefined
        }
    },
    created(){
        this.user = this.$store.getters.wxUserInfo;
        this.node_env = process.env.NODE_ENV
    },
    methods:{
        loginOut(){
            this.$store.commit('login_out');
            this.$router.push('/');
        }
    }
}
</script>
<style lang="scss" scoped>
    .log-out{
        position: absolute;
        bottom: 0;
    }
</style>